/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tuitionmanagement.DAO;

import java.sql.CallableStatement;
import java.sql.ResultSet;
import java.util.Vector;
import javax.swing.table.DefaultTableModel;
/**
 *
 * @author XUAN
 */
public class GetListStudentDAO {

    private final String SQL_SELECT = "SELECT * FROM Student";
    private final String SQL_SELECT_TUITION = "SELECT * FROM Tuition";

   
    public Vector<String> GetInfomationStudent(String _id) {
            CallableStatement cs = null;
            ResultSet rs = null;
            Vector<String> info = new Vector<String>();
            try {               
//                cs = ConnectionODBC.cnn.prepareCall(SQL_SELECT);
                cs.setString(1, _id);
                rs = cs.executeQuery();
                if (rs == null) {
                    System.out.println("Can not read Student Information!");
                } else {
                    while (rs.next()) {
                        info.addElement(rs.getString(1));
                        info.addElement(rs.getString(2));
                        info.addElement(rs.getString(3));
                        info.addElement(rs.getString(4));
                        info.addElement(rs.getString(5));
                        info.addElement(rs.getString(6));
                        info.addElement(rs.getString(7));
                    }
                }
                cs.close();
            } catch (Exception ex) {
                System.out.println(ex.getMessage());
            }
            return info;
        }

    public Vector<String> GetInfomationTuition(String _id) {
            CallableStatement cs = null;
            ResultSet rs = null;
            Vector<String> info = new Vector<String>();
            try {
//                ConnectionODBC.OpenConnection();
//                cs = ConnectionODBC.cnn.prepareCall(SQL_SELECT_TUITION);
//                cs.setString(1, _id);
                rs = cs.executeQuery();
                if (rs == null) {
                    System.out.println("Can not read Tuition Information!");
                } else {
                    while (rs.next()) {
                        info.addElement(rs.getString(1));
                        info.addElement(rs.getString(2));
                        info.addElement(rs.getString(3));
                        info.addElement(rs.getString(4));
                        info.addElement(rs.getString(5));
                        info.addElement(rs.getString(6));
                        info.addElement(rs.getString(7));
                    }
                }
                cs.close();
            } catch (Exception ex) {
                System.out.println(ex.getMessage());
            }
            return info;
        }
}
